﻿<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>click-to-call &middot; receive calls on your SIP softphone, mobile or fixed line from your website visitors</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Doubango Telecom">

    <!-- Le styles -->
    <link href="./assets/css/bootstrap.css" rel="stylesheet">
    <style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
    <link href="./assets/css/bootstrap-responsive.css" rel="stylesheet">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="../assets/js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="./assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="./assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="./assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="./assets/ico/apple-touch-icon-57-precomposed.png">
    <link rel="shortcut icon" href="./assets/ico/favicon.png">

    <script type="text/javascript">
        window.onload = function () {
            btnSave.disabled = !window.localStorage;
            btnRevert.disabled = !window.localStorage;

            settingsRevert(true);
        }

        function settingsSave() {
            window.localStorage.setItem('org.doubango.click2dial.admin.http_server_url', txtHttpServerUrl.value);
            window.localStorage.setItem('org.doubango.click2dial.admin.websocket_server_url', txtWebsocketServerUrl.value);
            window.localStorage.setItem('org.doubango.click2dial.admin.sip_outboundproxy_url', txtSIPOutboundProxyUrl.value);

            txtInfo.innerHTML = '<i>Saved</i>';
        }

        function settingsRevert(bNotUserAction) {
            if(window.localStorage){
                txtHttpServerUrl.value = (window.localStorage.getItem('org.doubango.click2dial.admin.http_server_url') || "");
                txtWebsocketServerUrl.value = (window.localStorage.getItem('org.doubango.click2dial.admin.websocket_server_url') || "");
                txtSIPOutboundProxyUrl.value = (window.localStorage.getItem('org.doubango.click2dial.admin.sip_outboundproxy_url') || "");
            }

            if (!bNotUserAction) {
                txtInfo.innerHTML = '<i>Reverted</i>';
            }
        }
    </script>
  </head>

  <body>
  
  <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" target=_blank href="http://doubango.org">Doubango Telecom</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li><a href="index.html">Home</a></li>
              <li class="active"><a href="#admin">Administration</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>



  <!-- Marketing messaging and featurettes
    ================================================== -->
    <!-- Wrap the rest of the page in another container to center all the content. -->
    <div class="container marketing">
        <div class="span7 well">
            <label align="center" id="txtInfo">This administration page is for developers to allow using your own servers.</label>
            <br />
            <table style='width: 100%'>
                <tr>
                    <td>
                        <label style="height: 100%">Http service URL<sup><a href="#aHttpServiceURL">[1]</a></sup>:</label>
                    </td>
                    <td>
                        <input type="text" style="width: 100%; height: 100%" id="txtHttpServerUrl" value="" placeholder="e.g. https://click2dial.org:10072" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <label style="height: 100%">WebSocket server URL<sup><a href="#aWebSocketServerURL">[2]</a></sup>:</label>
                    </td>
                    <td>
                        <input type="text" style="width: 100%; height: 100%" id="txtWebsocketServerUrl" value="" placeholder="e.g. wss://click2dial.org:10062" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <label style="height: 100%">SIP outbound Proxy URL<sup><a href="#aSIPOutboundProxyURL">[3]</a></sup>:</label>
                    </td>
                    <td>
                        <input type="text" style="width: 100%; height: 100%" id="txtSIPOutboundProxyUrl" value="" placeholder="e.g. udp://click2dial.org:5060" />
                    </td>
                </tr>

                <tr>
                    <td colspan="2" align="right">
                        <input type="button" class="btn-success" id="btnSave" value="Save" onclick='settingsSave();' />
                        &nbsp;
                        <input type="button" class="btn-danger" id="btnRevert" value="Revert" onclick='settingsRevert();' />
                    </td>
               </tr>
            </table>
        </div>
  </div><!-- /.container -->

    <hr />
    <footer>
        <a name="aHttpServiceURL"><sup><b>[1]</b></sup></a> Host name and port of the server hosting the click-to-call service. <br />

        <a name="aWebSocketServerURL"><sup><b>[2]</b></sup></a> The <b>WebSocket Server URL</b> is only required if you're a developer and using your own SIP Proxy gateway not publicly reachable. <br />

        <a name="aSIPOutboundProxyURL"><sup><b>[3]</b></sup></a> The <b>SIP outbound Proxy URL</b> is used to set the destination IP address and Port to use for all outgoing requests regardless the <i>domain name</i> (a.k.a <i>realm</i>).
        This is a good option for developers using a SIP domain name without valid DNS A/NAPTR/SRV records.
    </footer>


     <!-- ANALYTICS -->
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-6868621-25']);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="./assets/js/jquery.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-transition.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-alert.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-modal.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-dropdown.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-scrollspy.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-tab.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-tooltip.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-popover.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-button.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-collapse.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-carousel.js" type="text/javascript"></script>
    <script src="./assets/js/bootstrap-typeahead.js" type="text/javascript"></script>
    <script src="./assets/js/holder/holder.js" type="text/javascript"></script>
  </body>
  </html>